﻿using Chromium;
using NetDimension.NanUI.ResourceHandler;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetDimension.NanUI
{
    public class ZippedResource : CustomResource
    {
        private string ZipFilePath;
        private bool EnableCache;
        private string RootPath;

        public ZippedResource(ResourceHandlerScheme scheme, string domain, string zipFilePath, bool enableCache, string rootPath = "") : base(scheme, domain)
        {
            this.ZipFilePath = zipFilePath;
            this.EnableCache = enableCache;
            this.RootPath = rootPath;
        }

        protected override ResourceHandlerBase GetResourceHandler(string schemeName, CfxBrowser browser, CfxFrame frame, CfxRequest request)
        {
            return new ZippedResourceHandler(this.ZipFilePath, this.EnableCache,this.RootPath);
        }
    }
}
